package com.yingxin.yxerp.module.permission.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yingxin.yxerp.module.permission.entity.Permission;
import com.yingxin.yxerp.module.permission.vo.req.PermissionQueryVo;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 权限表 服务类
 * </p>
 *
 * @author fanchao
 * @since 2021-05-10
 */
public interface IPermissionService extends IService<Permission> {

    /**
     * 根据 permissionIds 查询
     */
    List<Permission> listByPermissionIds(Collection<String> permissionIds);

    List<Permission> listByParentId(String parentId);

    /**
     * 启用权限
     */
    void enable(Permission permission);

    /**
     * 禁用权限
     */
    void disable(Permission permission);

    /**
     * 验证 user id 是否存在指定的 permissionString 权限
     * false 不存在，true 存在
     */
    boolean checkPermissionByUserIdAndPermissionString(PermissionQueryVo queryVo);

}
